<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
//    SystemUser user = (SystemUser) session.getAttribute("loginUser");
    String username = null;
    try {
        username = session.getAttribute("name").toString();
        if (username == null) {
            response.sendRedirect("");
        } else {
//            username = user.getUsername();
            System.out.print("登录用户=====================================" + username);
        }
    } catch (Exception e) {
        response.sendRedirect("");
    }
%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>省 DPI 汇聚平台后台管理系统 v1.0</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
        <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="assets/css/font-awesome.min.css" />
        <link rel="stylesheet" href="assets/css/ace.min.css" />
        <link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
        <link rel="stylesheet" href="assets/css/ace-skins.min.css" />
    </head>

    <body>
        <div class="navbar navbar-default" id="navbar">

            <div class="navbar-container" id="navbar-container">
                <div class="navbar-header pull-left">
                    <a href="#" class="navbar-brand">
                        <small>
                            <!--<i class="icon-leaf"></i>-->
                           <!-- <img src="assets/images/ideal_logo.png" style="height:30px;" />-->
                            省DPI汇聚平台后台管理系统v1.0
                        </small>
                    </a><!-- /.brand -->
                </div><!-- /.navbar-header -->

                <div class="navbar-header pull-right" role="navigation">
                    <ul class="nav ace-nav">
                        <!--                        <li class="grey">
                                                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                                        <i class="icon-tasks"></i>
                                                        <span class="badge badge-grey">4</span>
                                                    </a>
                                                </li>
                                                <li class="purple">
                                                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                                        <i class="icon-bell-alt icon-animated-bell"></i>
                                                        <span class="badge badge-important">8</span>
                                                    </a>
                                                </li>
                                                <li class="green">
                                                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                                        <i class="icon-envelope icon-animated-vertical"></i>
                                                        <span class="badge badge-success">5</span>
                                                    </a>
                                                </li>-->
                        <li class="light-blue">
                            <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                                <img class="nav-user-photo" src="assets/avatars/user.jpg" alt="Jason's Photo" />
                                <span class="user-info">
                                    <small>欢迎光临,</small>
                                    <strong id="username"><%= username%></strong>
                                </span>
                                <i class="icon-caret-down"></i>
                            </a>
                            <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                                <!--                                <li>
                                                                    <a href="#">
                                                                        <i class="icon-cog"></i>
                                                                        设置
                                                                    </a>
                                                                </li>-->
                                <!--
                                                                <li>
                                                                    <a href="#">
                                                                        <i class="icon-user"></i>
                                                                        个人资料
                                                                    </a>
                                                                </li>-->

                                <li class="divider"></li>

                                <li>
                                    <a href="javascript:void(0)" onclick="logout()">
                                        <i class="icon-off"></i>
                                        退出
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul><!-- /.ace-nav -->
                </div><!-- /.navbar-header -->
            </div><!-- /.container -->
        </div>

        <div class="main-container" id="main-container">
            <div class="main-container-inner">
                <a class="menu-toggler" id="menu-toggler" href="#">
                    <span class="menu-text"></span>
                </a>
                <div class="sidebar" id="sidebar">

                </div>

                <div class="main-content">
                    <div class="breadcrumbs" id="breadcrumbs">                        
                        <ul class="breadcrumb">
                            <li>当前位置：</li>
                            <li></li>
                            <li class="active"></li>
                            <li class="active"></li>
                            <li class="active"></li>
                            <li class="active"></li>
                            <li class="active"></li>
                            <li class="active"></li>
                            <li class="active"></li>
                        </ul><!-- .breadcrumb -->
                    </div>
                    <iframe src="" id="page-content" width="100%" scrolling="no" style="border: none;" ></iframe>
                    <!-- /.page-content -->
                </div><!-- /.main-content -->
            </div><!-- /.main-container-inner -->

            <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
                <i class="icon-double-angle-up icon-only bigger-110"></i>
            </a>
        </div><!-- /.main-container -->
        <script src="assets/js/jquery.js"></script>
        <script src="assets/js/bootstrap.min.js"></script>
        <script src="assets/js/typeahead-bs2.min.js"></script>
        <!-- page specific plugin scripts -->
        <script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
        <!--<script src="assets/js/jquery.validate.js"></script>-->
        <!--<script src="assets/js/jquery.validate-util.js"></script>-->
        <!--<script src="assets/js/jquery.ui.touch-punch.min.js"></script>-->
        <!--<script src="assets/js/jquery.slimscroll.min.js"></script>-->

        <!--<script src="assets/js/fuelux/fuelux.wizard.min.js"></script>-->
        <!-- index -->
        <script src="assets/data/nav.js"></script>
        <script src="assets/js/gnsuite.js"></script>
        <!--<script src="assets/js/gnsuite_1.js"></script>-->

        <script>
                                        $(function() {
                                            var name = window.location.hash;
                                            $.nav.initNav({
                                                containerSelector: $(".sidebar"),
                                                navClass: "nav nav-list",
                                                navParentADom: function(data) {
                                                    return $("<a><i class='" + data.picture + "'></i><span class='menu-text'>" + data.name + "</span><b class='arrow icon-angle-down'></b></a>")
                                                },
                                                navChildrenADom: function(data) {
                                                    return $("<a><i class='" + data.picture + "'></i><span class='menu-text'>" + data.name + "</span></a>")
                                                },
                                                nodeNavClass: "submenu",
                                                nodeParentADom: function(data) {
                                                    return $("<a class='dropdown-toggle'><span class='menu-text'>" + data.name + "</span><b class='arrow icon-angle-down'></b></a>")
                                                },
                                                nodeChildrenADom: function(data) {
                                                    return $("<a class='dropdown-toggle'><span class='menu-text'>" + data.name + "</span></a>")
                                                },
                                                breadcrumbSelector: $(".breadcrumbs"),
                                                breadcrumbClass: "breadcrumb",
                                                breadcrumbDom: "<li class='active'></li>",
                                                parentActiveClass: "open active",
                                                childrenActiveClass: "active",
                                                positionNode: name,
                                                data: nav,
                                                refreshCallBack: function() {
                                                    $(".sidebar").append("<div class='sidebar-collapse' id='sidebar-collapse'><i class='icon-double-angle-left' data-icon1='icon-double-angle-left' data-icon2='icon-double-angle-right'></i></div>")
                                                },
                                                clickChildrenCallBack: function(e) {
                                                    var obj = JSON.parse(e.attr("data"));
                                                    obj.id = (typeof(obj.id) == "undefined") ? "" : obj.id;
                                                    refreshIframe(obj.path + obj.id);
                                                }
                                            });

                                        });
                                        //刷新iframe
                                        function refreshIframe(url) {
                                            $("#page-content").attr("height", 0);
                                            if ($.isFunction(url)) {
                                                url = url.call(this);
                                            }
                                            if (url.indexOf("/WebReport/") === -1) {
                                                $("#page-content").attr("scrolling", "yes");
                                                $("#page-content").attr("src", url);
                                            } else {
                                                $("#page-content").attr("scrolling", "yes");
                                                $("#page-content").attr("src", url);
                                            }
                                            var pageHeight = 0;
                                            if (window.innerHeight < document.body.scrollHeight) {
                                                pageHeight = document.body.scrollHeight - $(".navbar").height() - $(".breadcrumbs").height() - 10;
                                            } else {
                                                pageHeight = window.innerHeight - $(".navbar").height() - $(".breadcrumbs").height() - 10;
                                            }
                                            $("#page-content").attr("height", pageHeight);
                                        }
                                        function logout() {
                                            var flag = window.confirm("确认退出？");
                                            if (flag) {
                                                $.post("/action/user/login_out.do", {user: $("#username").text()}, function(data) {
                                                    window.location.assign("");
                                                });
                                            }
                                        }
//                                        $(window).bind('resize', function() {
//                                            var pageHeight = 0;
//                                            if (window.innerHeight < document.body.scrollHeight) {
//                                                pageHeight = document.body.scrollHeight - $(".navbar").height() - $(".breadcrumbs").height() - 10;
//                                            } else {
//                                                pageHeight = window.innerHeight - $(".navbar").height() - $(".breadcrumbs").height() - 10;
//                                            }
//                                            $("#page-content").attr("height", pageHeight);
//                                        }).trigger('resize');
        </script>
        <!-- ace scripts -->
        <script src="assets/js/ace-extra.min.js"></script>
        <script src="assets/js/ace-elements.min.js"></script>
        <script src="assets/js/ace.min.js"></script>
    </body>
</html>